const initialState = {
    loadList:[],
    sliceList:[],
    loadPage:0
}

export default (state = initialState, { type, payload }) => {
    let { loadList,sliceList,loadPage }=state
  switch (type) {

  case "GET_LOAD_LIST":
      loadList=payload
      loadPage=0
      sliceList=payload.sliceList(loadPage*10,(loadPage*10))
    return { ...state, loadList,sliceList}
  case "LOAO_LIST":
      loadPage++
     let newArr=loadList.slice(loadPage*10,(loadPage+1)*10)
       sliceList.push(...newArr)
      return { ...state, loadList,sliceList}
  default:
    return state
  }
}
